<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>后台管理系统</title>
    <link rel="stylesheet" href="/static/layui/layui/layui.js" />
    <link rel="stylesheet" href="/static/layui/layui/css/layui.css" />
    <link rel="stylesheet" href="/static/index/index.css">
    <link rel="stylesheet" href="/static/image/index.css">

</head>

<body background="/image/bg.png" class="bg_image">
    <div class="lyx_main">
        <fieldset class="layui-elem-field layui-field-title lyx_top ">
            <legend>欢迎登陆-程序员后台管理平台</legend>
        </fieldset>
        <div class="layui-containter ">
            <from class="layui-from " style="padding: 5px 20px 5px 20px; ">
                <div class="layui-row layui-col-space15 lyx_from ">
                    <div class="layui-col-xs12 layui-col-sm12 layui-col-md12 ">
                        <div class="layui-from-item ">
                            <input type="text" name="userName " lay-verify="userName" autocomplete="off " placeholder="账号 " class="layui-input ">
                        </div>
                        <i class="layui-icon layui-icon-username lyx_icon_user"></i>
                    </div>
                    <div class="layui-col-xs12 layui-col-sm12 layui-col-md12 ">
                        <div class="layui-item ">
                            <input type="password" name="passWord " lay-verify="passWord" autocomplete="off " placeholder="密码 " class="layui-input ">
                        </div>
                        <i class="layui-icon layui-icon-password lyx_icon_password "></i>
                    </div>
                    <div class="layui-col-xs12 layui-col-sm12 layui-col-md12 ">
                        <div class="layui-item ">
                            <button type="button " class="layui-btn layui-btn-fluid " lay-filter="submit1">立即登录</button>
                        </div>
                        <i></i>
                    </div>
                </div>
            </from>
        </div>
    </div>

    <script>
        //Demo
        layui.use('from', function(value) {
                    var from = layui.from;
                    //监听提交
                    $from.on('submit(submit1)', function(data) {
                        var date = data.field;
                        date['password'] = $.md5(date.password);
                        $.ajax({
                            url:'{:url("admin/login/getlogin")}',
                            method: 'post',
                            data: data.field,
                            dataType: 'JSON',
                            success: function(res) {
                               if (res.code==200) {
                                   layer.msg(data.msg,{time:500},function () {  
                                       window.location.href="{:url('admin/admin/admin')}"
                                   })
                                   else{
                                       layer.msg(data.msg);
                                   }
                                   
                               }
                            }

                        })

                    });
    </script>



</body>



</html>